package com.lagou.dubbo.service.impl;

import com.lagou.dubbo.service.ServerService;
import com.lagou.common.FilterConstant;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

import java.util.Random;

@Service
public class DubboServerServiceImpl implements ServerService {



    private String randomSleep() {
        Random random = new Random();
        int sleepTime = random.nextInt(101);
        try {
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return String.valueOf(sleepTime);
    }

    @Override
    public String methodA() {
        return randomSleep();
    }

    @Override
    public String methodB() {
        return randomSleep();
    }

    @Override
    public String methodC() {
        return randomSleep();
    }
}
